package com.pshare.artemis.order.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.pshare.artemis.order.bean.Order;
import com.pshare.artemis.parkingdevice.bean.Gateway;
import com.pshare.framework.mapper.BaseMapper;

public interface OrderMapper extends BaseMapper<Long,Order>{
	@Override
	@Insert("insert into tbl_order (user_open_id, lock_mac,lock_name,gateway_name) values (#{userOpenId},#{lockMac},#{lockName},#{gatewayName})")
	int add(Order order);
	
	@Select("select * from tbl_order where lock_mac=#{mac} ")
	List<Order> getByMac(@Param("mac") String mac);
	
	@Select("select * from tbl_order where user_open_id=#{openId} order by start_time desc ")
	List<Order> getByOpenId(@Param("openId") String openId);
	
	@Select("select * from tbl_order")
	List<Order> getAll();
	
	
}
